package com.laopan.wxpay.request.prepay;

import com.laopan.wxpay.WxConstants;
import com.laopan.wxpay.bean.prepay.JsapiPrepayOrder;
import com.laopan.wxpay.bean.prepay.PrepayResult;
import com.laopan.wxpay.config.WxPayConfig;
import com.laopan.wxpay.exception.WxPayException;
import com.laopan.wxpay.request.WxPayRequest;

/**
 * jsapi预支付
 *
 * @author laopan
 * @className JsapiPrepay
 * @date 2021/2/23 11:23
 */

public class JsapiPrepay extends WxPayRequest<JsapiPrepayOrder, PrepayResult> implements
        Prepay<JsapiPrepayOrder, PrepayResult> {
    public JsapiPrepay(WxPayConfig wxPayConfig) {
        super(wxPayConfig);
    }

    @Override
    protected Class<PrepayResult> getResultClass() {
        return PrepayResult.class;
    }

    @Override
    public PrepayResult prepay(JsapiPrepayOrder order) throws WxPayException {
        return post(WxConstants.JSAPI_PAY_PATH, order);
    }


}
